package com.cskaoyan.order.api;

import com.cskaoyan.mall.commons.result.ServiceCallResponse;
import com.cskaoyan.order.service.PayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayOrderApImpl {

    @Autowired
    PayOrderService payOrderService;

    // 定义方法接受调用请求
    @PutMapping(value = "/rpc/pay/success")
    ServiceCallResponse payOrderSuccess(@RequestParam("orderId") String orderId) {

        ServiceCallResponse serviceCallResponse = payOrderService.paySuccess(orderId);
        return serviceCallResponse;
    }

}
